<template>
  <div
    class="jy-style-height message-box"
    :style="{
      'background-image': `url(${publicUrls + 'free/style3/researchbg.png' + '?imageView2/3/format/webp'})`,
    }"
  >
    <img
      class="footer-logo-box"
      :src="publicUrls + 'free/style3/researchbglogo.png' + '?imageView2/3/format/webp'"
      alt=""
    />
    <div class="message-heard">
      <i class="freeIcon" @click="blankHome">&#xe642;</i>
      <span>留言板</span>
    </div>
    <div class="comment-box">
      <comment />
    </div>
    <div class="commentList-box">
      <div class="commentNum">共{{ total }}条留言</div>
      <div class="commentList-box-content">
        <ScrollBox
          color="rgba(50, 43, 37, 1)"
          :scrollSrc="publicUrls + 'free/style3/pen.png'"
          v-if="scrollheight"
          :byid="42325"
          :width="scrollheight"
        >
          <template #solidBorderCon>
            <commentList @emitTotal="emitTotal" />
          </template>
          <template #solidBorderEx>
            <div class="solidBorder-child"></div>
          </template>
        </ScrollBox>
      </div>
    </div>
  </div>
  <MenuNavigation />
</template> 

<script lang="ts">
// @ts-nocheck
export default defineComponent({
  name: 'style1',
});
</script>

<script setup lang="ts">
// @ts-nocheck
import MenuNavigation from '@/freeComponents/menuNavigation/index.vue';
import { defineComponent, ref } from 'vue';
import comment from '../messageComponent/style3/comment.vue';
import commentList from '../messageComponent/style3/commentList.vue';
import { publicUrls } from '@/utils/minxin';
import { commonDataStore } from '@/store';
const commonStore = commonDataStore();
import { useRouter, useRoute } from 'vue-router';
import ScrollBox from '../scrollBox.vue';
const router = useRouter();
const route = useRoute();
const total = ref(0);
const scrollheight = ref();

let viewportHeight = window.innerHeight;
scrollheight.value = viewportHeight * 0.3888;
const blankHome = () => {
  router.push({ name: route.meta.loopType ? 'exhibitionHome' : 'templateedit' });
};
const emitTotal = (num: number) => {
  total.value = num;
};
</script>

<style scoped lang="less">
.message-box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 88px 0;
  padding-bottom: 100px;
  background-size: 100% 100%;
}
.message-heard {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 56px;
  margin-bottom: 48px;
  padding: 0 123px;
  span {
    font-family: SourceHanSerifCN-Bold;
    font-size: 32px;
    color: #623333;
    line-height: 48px;
    text-align: center;
  }
  .freeIcon {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 123px;
    font-size: 24px;
    line-height: 24px;
    color: #623333;
  }
}
.comment-box {
  width: 100%;
  padding: 0 123px;
  margin-bottom: 32px;
}
.commentList-box {
  display: flex;
  flex-direction: column;
  padding: 0 123px;
  //   flex: 1;
  height: 400px;
  width: 100%;
}

.commentNum {
  width: 100%;
  height: 24px;
  font-family: PingFang SC;
  font-weight: 400;
  font-size: 16px;
  color: rgba(0, 0, 0, 0.59);
  line-height: 24px;
  text-align: left;
  margin-bottom: 24px;
}
.commentList-box-content {
  width: 100%;
  height: calc(100% - 24px);
  // overflow: auto;
}
.solidBorder-child {
  width: 4px;
  height: 100%;
  background: #623333;
  border-radius: 1px;
  opacity: 0.2;
}
:deep(.templatestyle1-scroll-box-tumb) {
  display: flex;
  justify-content: center;
  img {
    width: 24px;
    height: 24px; 
  }
}
.commentList-box-content::-webkit-scrollbar {
  display: none; 
}
.footer-logo-box {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 276px;
  height: 24px;
}
</style>